﻿using System;
using ParticlePlayground;

namespace UnityEngine
{
	// Token: 0x02000102 RID: 258
	public class PlaygroundSwitchMultithreadingMethod : MonoBehaviour
	{
		// Token: 0x060005A2 RID: 1442 RVA: 0x00022E44 File Offset: 0x00021044
		public virtual void Start()
		{
			this.globalManipulator = ParticlePlayground.PlaygroundC.GetManipulator(0);
		}

		// Token: 0x060005A3 RID: 1443 RVA: 0x00022E54 File Offset: 0x00021054
		public virtual void Update()
		{
			Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
			RaycastHit raycastHit;
			if (Physics.Raycast(ray, out raycastHit, 1000f))
			{
				this.globalManipulator.transform.transform.position = raycastHit.point;
			}
		}

		// Token: 0x060005A4 RID: 1444 RVA: 0x00022EA0 File Offset: 0x000210A0
		public virtual void OnGUI()
		{
			if (ParticlePlayground.PlaygroundC.reference.manipulators.Count > 0)
			{
				GUI.Label(new Rect((float)(Screen.width - 620), 10f, 300f, 25f), "Global Manipulator:");
				this.globalManipulator.enabled = GUI.Toggle(new Rect((float)(Screen.width - 620), 35f, 300f, 20f), this.globalManipulator.enabled, "Enabled");
				if (GUI.Button(new Rect((float)(Screen.width - 620), 55f, 300f, 20f), "Type: " + this.globalManipulator.type.ToString()))
				{
					this.SwitchManipulator();
				}
				GUI.Label(new Rect((float)(Screen.width - 620), 80f, 120f, 30f), "Strength");
				this.globalManipulator.strength = GUI.HorizontalSlider(new Rect((float)(Screen.width - 560), 85f, 210f, 30f), this.globalManipulator.strength, 0f, 10f);
				GUI.Label(new Rect((float)(Screen.width - 340), 80f, 60f, 30f), this.globalManipulator.strength.ToString("f1"));
			}
			GUI.Label(new Rect((float)(Screen.width - 310), 10f, 300f, 25f), "Multithreading:");
			if (GUI.Button(new Rect((float)(Screen.width - 310), 35f, 300f, 20f), "Thread Pool Method: " + ParticlePlayground.PlaygroundC.reference.threadPoolMethod.ToString()))
			{
				ParticlePlayground.SwitchMultithreading.NextThreadPoolMethod();
			}
			if (GUI.Button(new Rect((float)(Screen.width - 310), 55f, 300f, 20f), "Particle System Method: " + ParticlePlayground.PlaygroundC.reference.threadMethod.ToString()))
			{
				ParticlePlayground.SwitchMultithreading.NextParticleSystemMethod();
			}
			if (GUI.Button(new Rect((float)(Screen.width - 310), 75f, 300f, 20f), "Skinned Mesh Method: " + ParticlePlayground.PlaygroundC.reference.skinnedMeshThreadMethod.ToString()))
			{
				ParticlePlayground.SwitchMultithreading.NextSkinnedMeshMethod();
			}
			if (GUI.Button(new Rect((float)(Screen.width - 310), 95f, 300f, 20f), "Turbulence Method: " + ParticlePlayground.PlaygroundC.reference.turbulenceThreadMethod.ToString()))
			{
				ParticlePlayground.SwitchMultithreading.NextTurbulenceMethod();
			}
		}

		// Token: 0x060005A5 RID: 1445 RVA: 0x00023184 File Offset: 0x00021384
		public virtual void SwitchManipulator()
		{
			switch (this.globalManipulator.type)
			{
			case ParticlePlayground.MANIPULATORTYPEC.Attractor:
				this.globalManipulator.type = ParticlePlayground.MANIPULATORTYPEC.AttractorGravitational;
				break;
			case ParticlePlayground.MANIPULATORTYPEC.AttractorGravitational:
				this.globalManipulator.type = ParticlePlayground.MANIPULATORTYPEC.Repellent;
				break;
			case ParticlePlayground.MANIPULATORTYPEC.Repellent:
				this.globalManipulator.type = ParticlePlayground.MANIPULATORTYPEC.Vortex;
				break;
			case ParticlePlayground.MANIPULATORTYPEC.Vortex:
				this.globalManipulator.type = ParticlePlayground.MANIPULATORTYPEC.Attractor;
				break;
			}
		}

		// Token: 0x040005CA RID: 1482
		public ParticlePlayground.ManipulatorObjectC globalManipulator;
	}
}
